home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16188 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.6 KB

  1. Path: news.wwa.com!rmartin
  2. From: rmartin@oma.com (Robert C. Martin)
  3. Newsgroups: comp.lang.smalltalk,comp.object,comp.lang.c++,comp.lang.java
  4. Subject: Re: The Good, the Bad, the Ugly, and the Wicked ...
  5. Followup-To: comp.lang.smalltalk,comp.object,comp.lang.c++,comp.lang.java
  6. Date: 09 Apr 1996 21:00:10 GMT
  7. Organization: Object Mentor
  8. Message-ID: <RMARTIN.96Apr9160010@rcm.oma.com>
  9. References: <31570B8E.5A12@vmark.com> <4je5rq$7qg@mimas.brunel.ac.uk>
  10.     <4jes0t$gth@decaxp.HARVARD.EDU> <31630E30.5A02@oma.com>
  11.     <4kbq3q$1i8@gaia.ns.utk.edu>
  12. NNTP-Posting-Host: rcm.oma.com
  13. In-reply-to: mbk@caffeine.engr.utk.edu's message of 8 Apr 1996 19:40:42 GMT
  14.  
  15. In article <4kbq3q$1i8@gaia.ns.utk.edu> mbk@caffeine.engr.utk.edu (Matt Kennel) writes:
  16.  
  17.  
  18.    Robert C. Martin (rmartin@oma.com) wrote:
  19.  
  20.    : In any case, it matters little.  The more intense the real-time
  21.    : constraint, the more work the engineer will have to go through
  22.    : to manage the automatic garbage collector.  (e.g., turning it on or off,
  23.    : throttling it, forcing unscheduled collections, etc.)  Thus, eventually
  24.    : one merely trades the job of managing memory, for the job of
  25.    : managing the collector.
  26.  
  27.    It is not a trade, as nearly all garbage collection systems still
  28.    *allow* manual memory management.
  29.  
  30. Granted.  The trade off is in the decision of which approach to manage.
  31.  
  32.    A garbage collector provides a potential solution that is very difficult
  33.    to do without. 
  34.  
  35. In some cases.  In others it is difficult to live with.  There is no generic
  36. solution.
  37.  
  38.    : Malloc and new can *always* be made to be deterministic.  That is
  39.    : one of the major attractions to manual memory management in 
  40.    : real time systems.  You can use malloc/free (new/delete) pairs which are
  41.    : 100% predictable.
  42.  
  43.    Are they?  Have you gone through the all the possible orderings of
  44.    previous 'new' and 'malloc' so that you ***KNOW*** exactly
  45.    what the internal heap structures are so that subsequent calls to 
  46.    'malloc' and 'new' and 'free' take a known amount of time?
  47.  
  48. Yes.  Simply because it is possible to create memory allocators that
  49. don't use heaps.  Rather they use completely deterministic lists of
  50. preallocated blocks.  The time for 'new' and the time for 'delete' are
  51. absolutely constant.  The exact same number of instructions execute no
  52. matter what order new and delete are called in.
  53.  
  54.  
  55. --
  56. Robert Martin       | Design Consulting   | Training courses offered:
  57. Object Mentor Assoc.| rmartin@oma.com     |   OOA/D, C++, Advanced OO
  58. 14619 N. Somerset Cr| Tel: (847) 918-1004 |   Mgt. Overview of OOT
  59. Green Oaks IL 60048 | Fax: (847) 918-1023 | http://www.oma.com
  60.  
  61.